package com.edu.demo.entity.vo;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

/**
 * @Auther: XYH
 * @DATE: 2024年3月13日 21:25:24
 */

@Data
public class RegisterByPhone2VO {


    @NotBlank(message = "参数不能留白、不能只由空格、Tab、换行符组成")
    @NotNull(message = "用户名不能为空")
    @ApiModelProperty(value = "用户名", required = true)
    private String username;

    @ApiModelProperty(value = "密码",required = true)
    @Pattern(regexp = "^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d).+$", message = "密码必须包含大小写字母和数字")
    private String password;

    @NotNull(message = "手机号不能为空")
    @Pattern(regexp = "^(1[3-9])[0-9]{9}$", message = "手机号错误")
    @ApiModelProperty(value = "手机号",required = true)
    private String phone;

    @ApiModelProperty(value = "昵称",required = true)
    @Length(min = 1,max = 13,message = "昵称必须在1-13位")
    private String nickname;
}
